﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation = "false" CodeBehind="index.aspx.cs" Inherits="StreetSmartAdmin.index" %>
<%@ Register TagPrefix="CustUserCtrl" TagName="Header" Src="Header.ascx" %>
<%@ Register TagPrefix="CustUserCtrl" TagName="Footer" Src="Footer.ascx" %>
<%@ Register TagPrefix="CustUserCtrl" TagName="TRU" Src="TRU.ascx" %>
<%@ Register TagPrefix="CustUserCtrl" TagName="EA" Src="EA.ascx" %>
<%@ Register TagPrefix="CustUserCtrl" TagName="EATRU" Src="EA_TRU.ascx" %>
<%@ Register TagPrefix="CustUserCtrl" TagName="Qenergy" Src="Qenergy.ascx" %>
<%@ Register TagPrefix="CustUserCtrl" TagName="BlueENG" Src="BlueENG.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Street Smart Energy Admin</title>
    <link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
    <form id="form1" runat="server">
<script language="javascript" type="text/javascript" src="WdatePicker.js"></script>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="500000">
    </asp:Timer>



    <CustUserCtrl:Header id="Header" runat="server"></CustUserCtrl:Header>
    <div class="mGrid">    
                    <div style="padding:10px">         
                    <img alt="" src="images/logo.jpg" style="height: 79px" />
                    <asp:Label ID="Label5" runat="server" Visible="False"></asp:Label>
                    <asp:Label ID="Label10" runat="server" Visible="False"></asp:Label>
                    <asp:Label ID="Label11" runat="server" Visible="False"></asp:Label>
                    <asp:Label ID="Label17" runat="server" Visible="False"></asp:Label>
                    <asp:Label ID="Label18" runat="server" Visible="False"></asp:Label>
                    <asp:Label ID="Label19" runat="server" Visible="False"></asp:Label>
                    <br />
                    <br />
 <b>Search Users:</b>
 <br/>
 <asp:Panel ID="panSearch" runat="server" DefaultButton="ExactSearchButton" Width="100%" >
                    <asp:DropDownList ID="SearchDropDownList" runat="server" AutoPostBack="True"
                        onselectedindexchanged="SearchDropDownList_SelectedIndexChanged">   
            <asp:ListItem Value="All">All</asp:ListItem>    
            <asp:ListItem Value="UserID">User ID</asp:ListItem>
            <asp:ListItem Value="FirstName">First Name</asp:ListItem>
            <asp:ListItem Value="LastName">Last Name</asp:ListItem>
            <asp:ListItem Value="StateName">State</asp:ListItem>
            <asp:ListItem Value="Email">Email</asp:ListItem>                       
            <asp:ListItem Value="Phone">Phone & Mobile</asp:ListItem>
            <asp:ListItem Value="CurrentProvider">Provider</asp:ListItem>
            <asp:ListItem Value="TypeOrg">Organisation Type</asp:ListItem>
            <asp:ListItem Value="CompanyName">Company Name</asp:ListItem>          
            <asp:ListItem Value="AccountStatus">Account Status</asp:ListItem>
            <asp:ListItem Value="PreferredDay">Preferred Day</asp:ListItem>
            <asp:ListItem Value="PromotionCode">Promotion Code & Lead Source</asp:ListItem>   
            <asp:ListItem Value="OperatorSSE">Operator</asp:ListItem>       
        </asp:DropDownList>

                    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
                        onselectedindexchanged="DropDownList1_SelectedIndexChanged" 
                        DataSourceID="SqlDataSource6" DataTextField="AccountStatusName" DataValueField="AccountStatusName" />

                    <asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" 
                    DataSourceID="SqlDataSource8" DataTextField="PromotionCodeName" DataValueField="PromotionCodeName"
                    onselectedindexchanged="DropDownList2_SelectedIndexChanged" />

                    <asp:DropDownList ID="DropDownList3" runat="Server" AutoPostBack="True"
                        onselectedindexchanged="DropDownList3_SelectedIndexChanged">
                                        <asp:ListItem Value="ACT">ACT</asp:ListItem>
                                        <asp:ListItem Value="NSW">NSW</asp:ListItem>
                                        <asp:ListItem Value="NT">NT</asp:ListItem>
                                        <asp:ListItem Value="QLD">QLD</asp:ListItem>
                                        <asp:ListItem Value="SA">SA</asp:ListItem>
                                        <asp:ListItem Value="TAS">TAS</asp:ListItem>
                                        <asp:ListItem Value="VIC">VIC</asp:ListItem>
                                        <asp:ListItem Value="WA">WA</asp:ListItem>                     
                    </asp:DropDownList>

                    <asp:DropDownList ID="DropDownList4" AutoPostBack="True" runat="server"
                    DataSourceID="SqlDataSource37" DataTextField="CurrentProviderName" DataValueField="CurrentProviderName" />  

                    <asp:DropDownList ID="DropDownList5" runat="server" AutoPostBack="true">
                        <asp:ListItem Value="RESI">RESI</asp:ListItem>
                        <asp:ListItem Value="SME">SME</asp:ListItem>
                        <asp:ListItem Value="C&I">C&I</asp:ListItem>
                        </asp:DropDownList>

                        <asp:DropDownList ID="DropDownList6" runat="server" AutoPostBack="true" 
                        DataSourceID="SqlDataSource36" DataTextField="OperatorName" DataValueField="OperatorName" />

        <asp:TextBox ID="SearchTextBox" runat="server"></asp:TextBox>
                        <asp:Label ID="Label7" runat="server"></asp:Label>
                        <asp:TextBox ID="Date1" runat="server" width="100px" onclick="WdatePicker()" 
                            ontextchanged="Date1_TextChanged"></asp:TextBox>
                        <asp:Label ID="Label8" runat="server"></asp:Label>
                        <asp:TextBox ID="Date2" runat="server" width="100px" onclick="WdatePicker()" 
                            ontextchanged="Date2_TextChanged"></asp:TextBox>
        <asp:Button ID="ExactSearchButton" runat="server" Text="Search" 
                            onclick="ExactSearchButton_Click"/>
                            &nbsp &nbsp
        <asp:Button ID="Edit" runat="server" width="80px" onclick="Edit_Click" Text="Edit" />
        <asp:Button ID="CreateNew" runat="server" width="80px" onclick="CreateNew_Click" Text="Add New" 
                            style="height: 26px" />

                        <asp:Button ID="Button5" runat="server" onclick="Button5_Click" 
                            Text="Hide/Show" />
                        <asp:Button ID="Button3" runat="server" onclick="Button3_Click" Text="Export" />
                    <br />
                    <br />
                    
                        <asp:Button ID="Button6" runat="server" onclick="Button6_Click" 
                            Text="Send Email" Visible="true" />
                        <asp:Button ID="Button7" runat="server" onclick="Button7_Click" 
                            Text="Confirm Sending" Visible="false"/>
                        <asp:Button ID="Button8" runat="server" onclick="Button8_Click" Text="Cancel" 
                            Visible="False" />
                        <asp:Button ID="Button9" runat="server" onclick="Button9_Click" 
                        OnClientClick = "return confirm('Are you sure you want to send Bulk Email?');" 
                            Text="Send Bulk Email" Visible="False" />
                        <asp:Label ID="Label14" runat="server"></asp:Label>
                        <asp:Label ID="Label15" runat="server"></asp:Label>
                        <asp:Label ID="Label16" runat="server" Visible="False"></asp:Label>
                        </asp:Panel>
        <br />
        <br />
         <asp:Panel ID="pnlSelectEmail" runat="server" Visible="false">
            <div>
<asp:DropDownList  OnSelectedIndexChanged="ddlEmail_SelectedIndexChanged"  ID="ddlET" runat="server" AutoPostBack="True"
 DataSourceID="SqlETSource"  DataTextField="EmailTemplateName" DataValueField="EmailTemplateID">  
    </asp:DropDownList> 
    Email Template:&nbsp;<asp:label ID="lblTemplateName"  name="lblTemplateName" runat="server" Text="" /> &nbsp;
    Subject:&nbsp;<asp:label ID="lblTemplateSubject"  name="lblTemplateSubject" runat="server" Text="" />  &nbsp;
    Body:<br /><asp:label ID="lblTemplateBody"  name="lblTemplateBody" runat="server" Text="" /> <br />
</div>
                    <asp:SqlDataSource ID="SqlETSource" runat="server" ConnectionString='<%$ ConnectionStrings:SQLServer2005DBConnectionString %>'
    SelectCommand="Select EmailTemplateID,EmailTemplateName FROM tblEmailTemplate UNION
        SELECT 0 AS EmailTemplateID, 'Please Select' AS EmailTemplateName" >
</asp:SqlDataSource>
         </asp:Panel>
         <br />
         <asp:Label ID="Label6" runat="server" Text="Page Size"></asp:Label>
                        <asp:DropDownList ID="PageSizeList" runat="server" AutoPostBack="True"
                        onselectedindexchanged="PageSizeList_SelectedIndexChanged">                                     
                                        <asp:ListItem Value="20">20</asp:ListItem>
                                        <asp:ListItem Value="10">10</asp:ListItem>
                                        <asp:ListItem Value="50">50</asp:ListItem>
                                        <asp:ListItem Value="100">100</asp:ListItem>
                                        <asp:ListItem Value="200">200</asp:ListItem>
                                        <asp:ListItem Value="500">500</asp:ListItem>
                                        <asp:ListItem Value="1000">1000</asp:ListItem>
                    </asp:DropDownList>        
                        <asp:Label ID="Label13" runat="server" Text="Total Records:"></asp:Label>
                        <asp:Label ID="Label12" runat="server"></asp:Label>
                        <div style="vertical-align:top; height:750px; overflow:auto; width:95%;">
                <asp:GridView ID="GridView1" runat="server" CssClass="mGrid"
            PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" 
            DataSourceID="SqlDataSource0" AutoGenerateColumns="False" 
            DataKeyNames="UserID" AllowPaging="True"
            onselectedindexchanged="GridView1_SelectedIndexChanged" 
            EnableModelValidation="True" PageSize="50" AllowSorting="true">
<AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
            <Columns>
                <asp:BoundField DataField="UserID" HeaderText="UserID" 
                    SortExpression="UserID" />
                <asp:BoundField DataField="OperatorSSE" HeaderText="Operator" 
                    SortExpression="OperatorSSE" />
                <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                    SortExpression="FirstName" />
                <asp:BoundField DataField="LastName" HeaderText="LastName" 
                    SortExpression="LastName" />
                <asp:BoundField DataField="TypeOrg" HeaderText="OrgType" 
                    SortExpression="TypeOrg" />
                <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" 
                    SortExpression="CompanyName" />
                <asp:BoundField DataField="Email" HeaderText="Email" 
                    SortExpression="Email" />
                <asp:BoundField DataField="Phone" HeaderText="Phone" 
                    SortExpression="Phone" />
                <asp:BoundField DataField="PromotionCode" HeaderText="PromotionCode" 
                    SortExpression="PromotionCode" />
                <asp:BoundField DataField="StateName" HeaderText="StateName" 
                    SortExpression="StateName" />
                <asp:BoundField DataField="Postcode" HeaderText="Postcode" 
                    SortExpression="Postcode" />               
                <asp:BoundField DataField="StatusName" HeaderText="AccountStatus" 
                    SortExpression="StatusName" />
                    <asp:BoundField DataField="InsertDate" HeaderText="DateRegistered" 
                    SortExpression="InsertDate" />
                    <asp:BoundField DataField="DateConverted" HeaderText="DateConverted" 
                    SortExpression="DateConverted" />
                    <asp:BoundField DataField="PreferredDay" HeaderText="PreferredDay" 
                    SortExpression="PreferredDay" />
                    <asp:BoundField DataField="PreferredTime" HeaderText="PreferredTime" 
                    SortExpression="PreferredTime" /> 
                    <asp:BoundField DataField="GolfClub" HeaderText="GolfClub" 
                    SortExpression="GolfClub" />                         
                    <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                            CommandName="Select" Text="Select"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
      
                    <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                            CommandName="Delete" Text="Delete" OnClientClick="return confirm('Are You Sure to Delete?')"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField> 
            </Columns>

<PagerStyle CssClass="pgr"></PagerStyle>
        </asp:GridView>
        </div>
                    <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="First" />
                    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Last" />
        <br/>

                        <br />
 <asp:DetailsView ID="DetailsView0" runat="Server" CellPadding="4" ForeColor="#333333"
                        GridLines="None" DataSourceID="SqlDataSource2" AllowPaging="True" AutoGenerateRows="False"
                        DataKeyNames="userID" AutoGenerateInsertButton="True" DefaultMode="Edit" CssClass="mGrid"
                        PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" 
                            EnableModelValidation="True">
                        <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
                        <Fields>
                        <asp:TemplateField HeaderText="userID" >
                                <ItemTemplate>                           
                                    <asp:Label ID="lbluserID" runat="server" Text='<%# Eval("userID") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Registration Date" >
                                <ItemTemplate>   
                                    <asp:Label ID="lblInsertDate" runat="server" Text='<%# Eval("InsertDate")%>' />
                                </ItemTemplate>
                            </asp:TemplateField>


                            <asp:TemplateField HeaderText="Date Converted">
                                <ItemTemplate>
                                    <asp:Label ID="lblDateConverted" runat="server" Text='<%# bind("DateConverted")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="DateConverted" runat="server" Text='<%# Bind("DateConverted") %>' onclick="WdatePicker()" ></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>


                            <asp:TemplateField HeaderText="Company Name" >
                                <ItemTemplate>
                                    <asp:Label ID="lblCompanyName" runat="server" Text='<%# bind("CompanyName")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="CompanyName" runat="server" Text='<%# Bind("CompanyName") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="First Name" >
                                <ItemTemplate>
                                    <asp:Label ID="lblFirstName" runat="server" Text='<%# bind("FirstName")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="FirstName" runat="server" Text='<%# Bind("FirstName") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Last Name" >
                                <ItemTemplate>
                                    <asp:Label ID="lblLastName" runat="server" Text='<%# bind("LastName")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="LastName" runat="server" Text='<%# Bind("LastName") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Street" >
                                <ItemTemplate>
                                    <asp:Label ID="lblStreet" runat="server" Text='<%# bind("Street")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="Street" runat="server" Text='<%# Bind("Street") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Suburb" >
                                <ItemTemplate>
                                    <asp:Label ID="lblSuburb" runat="server" Text='<%# bind("Suburb")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="Suburb" runat="server" Text='<%# Bind("Suburb") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="State" >
                                <EditItemTemplate>
                                    <asp:TextBox ID="StateName" runat="server" Text='<%# Bind("StateName") %>'></asp:TextBox>    
                                    <asp:DropDownList name="selStateName" ID="selStateName" runat="Server" HeaderText="StateName" onchange="StateName0Changed()">
                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                        <asp:ListItem Value="ACT">ACT</asp:ListItem>
                                        <asp:ListItem Value="NSW">NSW</asp:ListItem>
                                        <asp:ListItem Value="NT">NT</asp:ListItem>
                                        <asp:ListItem Value="QLD">QLD</asp:ListItem>
                                        <asp:ListItem Value="SA">SA</asp:ListItem>
                                        <asp:ListItem Value="TAS">TAS</asp:ListItem>
                                        <asp:ListItem Value="VIC">VIC</asp:ListItem>
                                        <asp:ListItem Value="WA">WA</asp:ListItem>                     
                                    </asp:DropDownList>               
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Postcode" >
                                <ItemTemplate>
                                    <asp:Label ID="lblPostcode" runat="server" Text='<%# bind("Postcode")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="Postcode" runat="server" Text='<%# Bind("Postcode") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Email" >
                                <ItemTemplate>
                                    <asp:Label ID="lblEmail" runat="server" Text='<%# bind("Email")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="Email" runat="server" Text='<%# Bind("Email") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>                          
                            
                            <asp:TemplateField HeaderText="Contact Tel" >
                                <ItemTemplate>
                                    <asp:Label ID="lblPhone" runat="server" Text='<%# bind("Phone")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="Phone" runat="server" Text='<%# Bind("Phone") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Second Tel" >
                                <ItemTemplate>
                                    <asp:Label ID="lblMobile" runat="server" Text='<%# bind("Mobile")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="Mobile" runat="server" Text='<%# Bind("Mobile") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Preferred Day To Contact" >
                                <ItemTemplate>
                                    <asp:Label ID="lblPreferredDay" runat="server" Text='<%# bind("PreferredDay")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="PreferredDay" runat="server" onclick="WdatePicker()" Text='<%# Bind("PreferredDay") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Preferred Time To Contact" >
                                <EditItemTemplate>
                                <asp:TextBox ID="PreferredTime" runat="server" Text='<%# Bind("PreferredTime") %>'></asp:TextBox>                                   
                                    <asp:DropDownList name="selPreferredTime" ID="selPreferredTime" runat="Server" HeaderText="Preferred Time" onchange="PreferredTime0Changed()">
                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                        <asp:ListItem Value="8:00 AM - 9:00 AM">8:00 AM - 9:00 AM</asp:ListItem>
                                        <asp:ListItem Value="9:00 AM - 10:00 AM">9:00 AM - 10:00 AM</asp:ListItem>
                                        <asp:ListItem Value="10:00 AM - 11:00 AM">10:00 AM - 11:00 AM</asp:ListItem>
                                        <asp:ListItem Value="11:00 AM - 12:00 AM">11:00 AM - 12:00 AM</asp:ListItem>
                                        <asp:ListItem Value="12:00 AM - 1:00 PM">12:00 AM - 1:00 PM</asp:ListItem>
                                        <asp:ListItem Value="1:00 PM - 2:00 PM">1:00 PM - 2:00 PM</asp:ListItem>
                                        <asp:ListItem Value="2:00 PM - 3:00 PM">2:00 PM - 3:00 PM</asp:ListItem>
                                        <asp:ListItem Value="3:00 PM - 4:00 PM">3:00 PM - 4:00 PM</asp:ListItem>
                                        <asp:ListItem Value="4:00 PM - 5:00 PM">4:00 PM - 5:00 PM</asp:ListItem>
                                        <asp:ListItem Value="5:00 PM - 6:00 PM">5:00 PM - 6:00 PM</asp:ListItem>
                                        <asp:ListItem Value="6:00 PM - 7:00 PM">6:00 PM - 7:00 PM</asp:ListItem>
                                        <asp:ListItem Value="7:00 PM - 8:00 PM">7:00 PM - 8:00 PM</asp:ListItem>
                                        <asp:ListItem Value="8:00 PM - 9:00 PM">8:00 PM - 9:00 PM</asp:ListItem>
                                    </asp:DropDownList> 
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Promotion Code" >
                                <ItemTemplate>
                                    <asp:Label ID="lblPromotionCode" runat="server" Text='<%# bind("PromotionCode")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="PromotionCode" runat="server" Text='<%# Bind("PromotionCode") %>' visible="true"></asp:TextBox>
                                    <asp:DropDownList name="selPromotionCode" ID="selPromotionCode" runat="Server" DataSourceID="SqlDataSource8" 
                                    DataTextField="PromotionCodeName" DataValueField="PromotionCodeName" onchange="PromotionCode0Changed()" />                                      															
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Lead Source Code" >
                                <ItemTemplate>
                                    <asp:Label ID="lblLeadSource" runat="server" Text='<%# bind("LeadSource")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="LeadSource" runat="server" Text='<%# Bind("LeadSource") %>' Visible="true"></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Organisation Type" >
                                <ItemTemplate>
                                    <asp:Label ID="lblTypeOrg" runat="server" Text='<%# bind("TypeOrg")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TypeOrg" runat="server" Text='<%# Bind("TypeOrg") %>'></asp:TextBox>
                                    <asp:DropDownList name="selTypeOrg" ID="selTypeOrg" runat="Server" HeaderText="Organisation Type" onchange="TypeOrg0Changed()">
                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                        <asp:ListItem Value="RESI">RESI</asp:ListItem>
                                        <asp:ListItem Value="SME">SME</asp:ListItem>
                                        <asp:ListItem Value="C&I">C&I</asp:ListItem>
                                    </asp:DropDownList>
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Account Status" >
                                <ItemTemplate>
                                    <asp:Label ID="lblAccountStatus" runat="server" Text='<%# bind("AccountStatus")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>

                                    <asp:TextBox ID="StatusName" runat="server" Text='<%# Bind("StatusName") %>'></asp:TextBox>
                                    <asp:DropDownList name="selAccountStatus" ID="selAccountStatus" runat="Server" HeaderText="Account Status" onchange="AccountStatus0Changed()"
                                    DataSourceID="SqlDataSource6" DataTextField="AccountStatusName" DataValueField="AccountStatusName" />
                                    
                                    <br />
                                    <asp:TextBox ID="AccountStatusHistory" Rows="5" cols="40" Width="60%" runat="server"
                                        TextMode="MultiLine" Text='<%# Bind("AccountStatusHistory") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Comments" >
                                <EditItemTemplate>
                                    Add Notes<input type="text" id="addcomments" size="75" />
                                    <asp:TextBox ID="Comments" Rows="5" cols="40" Width="97%" runat="server" TextMode="MultiLine"
                                        Text='<%# Bind("Comments") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("Comments") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>



                            <asp:TemplateField HeaderText="SSE Operator">
                                <EditItemTemplate>
                                <asp:TextBox ID="OperatorSSE" runat="server" Text='<%# Bind("OperatorSSE") %>'></asp:TextBox>
                                    <asp:DropDownList name="selOperatorSSE" ID="selOperatorSSE" runat="Server" HeaderText="Operator SSE" onchange="OperatorSSE0Changed()"
                                     DataSourceID="SqlDataSource36" DataTextField="OperatorName" DataValueField="OperatorName" />
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Current Provider" >
                                <ItemTemplate>
                                    <asp:Label ID="lblcurrprovider" runat="server" Text='<%# bind("CurrentProvider")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="CurrentProvider" runat="server" Text='<%# Bind("CurrentProvider") %>'></asp:TextBox>
                                      <asp:DropDownList name="selCurrentProvider" id="selCurrentProvider" DataSourceID="SqlDataSource37"
                                        DataTextField="CurrentProviderName" DataValueField="CurrentProviderName" onchange="CurrentProvider0Changed()" runat="server"/>
                                </EditItemTemplate>
                            </asp:TemplateField>


                            <asp:TemplateField HeaderText="New Provider" >
                                <ItemTemplate>
                                    <asp:Label ID="lblNewProvider" runat="server" Text='<%# bind("NewProvider")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="NewProvider" runat="server" Text='<%# Bind("NewProvider") %>'></asp:TextBox>
                                    <asp:DropDownList name="selNewProvider" ID="selNewProvider" runat="Server" AutoPostBack="true"  onchange="NewProvider0Changed()" OnSelectedIndexChanged="selProviderChanged"
                                     DataSourceID="SqlDataSource44" DataTextField="NewProviderName" DataValueField="NewProviderName" />
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:CommandField ShowEditButton="True" ButtonType="Button" />

                            <asp:CommandField ShowInsertButton="True" ButtonType="Button" />

                        </Fields>

<PagerStyle CssClass="pgr"></PagerStyle>
                        </asp:DetailsView>

                    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0"    >
            <asp:View ID="View0" runat="server">                       
            </asp:View>
            <asp:View ID="View1" runat="server">
            <CustUserCtrl:TRU id="TRU" runat="server"></CustUserCtrl:TRU> 
            </asp:View>
            <asp:View ID="View2" runat="server">
            <CustUserCtrl:EA id="EA" runat="server"></CustUserCtrl:EA>  
            </asp:View>
            <asp:View ID="View3" runat="server">               
            <CustUserCtrl:EATRU id="EATRU" runat="server"></CustUserCtrl:EATRU>                 
            </asp:View>
            <asp:View ID="View4" runat="server">          
                 <CustUserCtrl:Qenergy id="Qenergy" runat="server"></CustUserCtrl:Qenergy>             
            </asp:View>
            <asp:View ID="View5" runat="server">            
                <CustUserCtrl:BlueENG id="BlueENG" runat="server"></CustUserCtrl:BlueENG>
            </asp:View>
        </asp:MultiView>

          
                    <asp:TextBox ID="ttb" runat="server" visible="false"></asp:TextBox>
                    <asp:TextBox ID="tbPro" runat="server" visible="false"></asp:TextBox>

                                          <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString='<%$ ConnectionStrings:SQLServer2005DBConnectionString %>'
                        SelectCommand="Select * FROM tbluser WHERE userID = @userID" 
                        DeleteCommand="Delete FROM tbluser WHERE userID = @userID"
                        InsertCommand="INSERT INTO tbluser ( 
        FirstName,
        LastName,
        Email,
        CompanyName, 
        Street,
		Suburb,
        StateName, 
        Postcode,  
        Phone,  
        Mobile,     
        CurrentProvider,   
        PromotionCode,
        LeadSource,
        Comments,
        TypeOrg, 
        PreferredDay,
        PreferredTime,
        StatusName,
        AccountStatusHistory,
        OperatorSSE,
        DateConverted,
        NewProvider
        ) VALUES (
        @FirstName,
        @LastName,
        @Email,
        @CompanyName, 
        @Street,
		@Suburb,
        @StateName, 
        @Postcode,  
        @Phone,  
        @Mobile,     
        @CurrentProvider,   
        @PromotionCode,
        @LeadSource,
        @Comments,
        @TypeOrg, 
        @PreferredDay,
        @PreferredTime,
        @StatusName,
        @AccountStatusHistory,
        @OperatorSSE,
        @DateConverted,
        @NewProvider
        )"
        UpdateCommand="UPDATE tbluser SET     
        FirstName = @FirstName,
        LastName = @LastName,
        Email = @Email,
        CompanyName = @CompanyName, 
        Street = @Street,
		Suburb = @Suburb,
        StateName = @StateName, 
        Postcode = @Postcode,  
        Phone = @Phone,  
        Mobile = @Mobile,     
        CurrentProvider = @CurrentProvider,   
        PromotionCode = @PromotionCode,
        LeadSource = @LeadSource,
        Comments = @Comments,
        TypeOrg = @TypeOrg, 
        PreferredDay=@PreferredDay,
        PreferredTime=@PreferredTime,
        StatusName=@StatusName,
        AccountStatusHistory=@AccountStatusHistory,
        OperatorSSE=@OperatorSSE,
        DateConverted=@DateConverted,
        NewProvider=@NewProvider
        WHERE userID = @userID">
                        <SelectParameters>
							<asp:ControlParameter ControlID="GridView1" Name="UserID" PropertyName="selectedvalue" /> 
                        </SelectParameters>
                        <DeleteParameters>
                            <asp:Parameter Name="userID" />
                        </DeleteParameters>
                        <UpdateParameters>
                        </UpdateParameters>
                        <InsertParameters>
                        </InsertParameters>
                    </asp:SqlDataSource>   

                    <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
                    ConnectionString='<%$ ConnectionStrings:SQLServer2005DBConnectionString %>'
                    SelectCommand="Select * FROM tblAccountStatus">
                    </asp:SqlDataSource>
                    
                    <asp:SqlDataSource ID="SqlDataSource0" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
                    SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE FROM tblUser where StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">                 
                    <SelectParameters>
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" /> 
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource9" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE FROM tblUser where FirstName=@Value and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="SearchTextBox" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" /> 
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource10" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE FROM tblUser where LastName=@Value and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="SearchTextBox" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" /> 
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource11" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where StateName=@Value and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="DropDownList3" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" /> 
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource12" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where AccountStatus=@Value and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="DropDownList1" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource13" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where (PromotionCode like '%'+ @Value + '%' or LeadSource like '%'+ @Value + '%') and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="DropDownList2" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" /> 
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource14" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where Email like '%'+ @Value + '%' and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="SearchTextBox" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" /> 
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource15" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where UserID=@Value and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="SearchTextBox" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" /> 
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource16" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where StatusName<>@Status1 and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID desc"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
                    <SelectParameters>
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" /> 
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource17" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where FirstName=@Value and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID desc"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="SearchTextBox" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource18" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where LastName=@Value and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID desc"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="SearchTextBox" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource19" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where StateName=@Value and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID desc"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="DropDownList3" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource20" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where AccountStatus=@Value and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID desc"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="DropDownList1" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource21" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where (PromotionCode like '%'+ @Value + '%' or LeadSource like '%'+ @Value + '%') and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID desc"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="DropDownList2" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource22" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where Email like '%'+ @Value + '%' and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID desc"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="SearchTextBox" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource23" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where (Phone=@Value or Mobile=@Value) and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="SearchTextBox" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource24" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where CompanyName like '%'+ @Value + '%' and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="SearchTextBox" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource25" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where CurrentProvider like '%'+ @Value + '%' and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="DropDownList4" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource26" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where (Phone=@Value or Mobile=@Value) and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID desc"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="SearchTextBox" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource27" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where CompanyName like '%'+ @Value + '%' and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID desc"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="SearchTextBox" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource28" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where CurrentProvider like '%'+ @Value + '%' and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID desc"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="DropDownList4" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource29" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where (UserID like '%'+ @Value + '%'or FirstName=@Value or LastName=@Value or CompanyName like '%'+ @Value + '%' or Email=@Value or Phone=@Value or StateName=@Value or StatusName=@Value or PostCode=@Value or CurrentProvider like '%'+ @Value + '%' or PromotionCode like '%'+ @Value + '%') and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="SearchTextBox" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource30" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where (UserID like '%'+ @Value + '%'or FirstName=@Value or LastName=@Value or CompanyName like '%'+ @Value + '%' or Email=@Value or Phone=@Value or StateName=@Value or StatusName=@Value or PostCode=@Value or CurrentProvider like '%'+ @Value + '%' or PromotionCode like '%'+ @Value + '%') and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID desc"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="SearchTextBox" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource31" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where (PreferredDay >= @Value1 and PreferredDay <= @Value2) and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="Date1" Name="Value1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="Date2" Name="Value2" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource32" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where (PreferredDay >= @Value1 and PreferredDay <= @Value2) and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID desc"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="Date1" Name="Value1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="Date2" Name="Value2" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource33" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where TypeOrg=@Value and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="DropDownList5" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource34" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where TypeOrg=@Value and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID desc"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="DropDownList5" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource7" runat="server" 
                    ConnectionString='<%$ ConnectionStrings:SQLServer2005DBConnectionString %>'
                    SelectCommand="Select * FROM tblAccountStatus">
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource8" runat="server" 
                    ConnectionString='<%$ ConnectionStrings:SQLServer2005DBConnectionString %>'
                    SelectCommand="Select * FROM tblPromotionCode">
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource36" runat="server" 
                    ConnectionString='<%$ ConnectionStrings:SQLServer2005DBConnectionString %>'
                    SelectCommand="Select * FROM tblOperator">
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource37" runat="server" 
                    ConnectionString='<%$ ConnectionStrings:SQLServer2005DBConnectionString %>'
                    SelectCommand="Select * FROM tblCurrentProvider">
                    </asp:SqlDataSource>                    

                    <asp:SqlDataSource ID="SqlDataSource38" runat="server" 
                    ConnectionString='<%$ ConnectionStrings:SQLServer2005DBConnectionString %>'
                    SelectCommand="Select * FROM ProductTypeRESI">
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource39" runat="server" 
                    ConnectionString='<%$ ConnectionStrings:SQLServer2005DBConnectionString %>'
                    SelectCommand="Select * FROM ProductTypeSME">
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource40" runat="server" 
                    ConnectionString='<%$ ConnectionStrings:SQLServer2005DBConnectionString %>'
                    SelectCommand="Select * FROM SourceCodeRESI">
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource41" runat="server" 
                    ConnectionString='<%$ ConnectionStrings:SQLServer2005DBConnectionString %>'
                    SelectCommand="Select * FROM SourceCodeSME">
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource44" runat="server" 
                    ConnectionString='<%$ ConnectionStrings:SQLServer2005DBConnectionString %>'
                    SelectCommand="Select * FROM tblNewProvider">
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource42" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where OperatorSSE=@Value and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="DropDownList6" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource43" runat="server" 
					ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"             
					SelectCommand = "SELECT UserID, FirstName, LastName, TypeOrg, CompanyName, Email, Phone, PromotionCode, StateName, Postcode, StatusName, InsertDate, DateConverted, PreferredDay, PreferredTime, GolfClub, OperatorSSE  FROM tblUser where OperatorSSE=@Value and StatusName<>@Status1 and StatusName<>@Status2 and StatusName<>@Status3 and StatusName<>@Status4 and StatusName<>@Status5 order by UserID desc"
                    DeleteCommand = "DELETE from tblUser where UserID=@UserID">
					<SelectParameters>
                    <asp:ControlParameter ControlID="DropDownList6" Name="Value" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label10" Name="Status1" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label11" Name="Status2" Type="String" PropertyName="Text" />
                    <asp:ControlParameter ControlID="label17" Name="Status3" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label18" Name="Status4" Type="String" PropertyName="Text" /> 
                    <asp:ControlParameter ControlID="label19" Name="Status5" Type="String" PropertyName="Text" />  
                    </SelectParameters>
                    </asp:SqlDataSource>

                    </div>
    </div>
    </form>
</body>

<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="date.f-0.5.0-min.js" type="text/javascript"></script>
<script src="sse.js" type="text/javascript"></script>
<script src="TRU.js" type="text/javascript"></script>
<script src="EA.js" type="text/javascript"></script>
<script src="EATRU.js" type="text/javascript"></script>

</html>
